package core

import "github.com/robfig/cron/v3"

var c = cron.New()

func RegCron(spec string, cmd func()) {
	_, _ = c.AddFunc(spec, cmd)
}

func StartCron() {
	if GetViper().GetBool("cron.enable") {
		c.Start()
	}
}
